import http from "@/utils/http"
//获取所有角色
export const rolesApi = () => {
    return http.get("/auth/role/roles");
}

//获取角色id
export const roleByUserIdApi = (roleId) => {
    return http.get(`/auth/role/roles/${roleId}`);
}

//新增
export const addRoleApi = (data) => {
    return http.post("/auth/role/add", data);
}
//编辑
export const editRoleApi = (data) => {
    return http.post("/auth/role/edit", data);
}

//按角色id检索角色
export const roleInfoByIdApi = (roleId) => {
    return http.get(`/auth/role/info/${roleId}`);
}
// 删除角色
export const delRoleApi = (roleId) => {
    return http.get(`/auth/role/del/${roleId}`);
}
//分配权限
export const assignMenuApi = (data) => {
    return http.post("/auth/role/assign", data);
}